package com.plsjavaweb.dao.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

import org.apache.log4j.Logger;

import com.plsjavaweb.dao.DAOFactory;
import com.plsjavaweb.logging.LoggingConstants;
import com.plsjavaweb.pojo.ProjectPOJO;

public class ProjectSeatAllocationMapper implements Mapper<ProjectPOJO>{	
	Logger log = Logger.getLogger(DAOFactory.class);

	@Override
	public List<ProjectPOJO> MapList(ResultSet rs) throws SQLException {
		log.info(LoggingConstants.entryMessage);
		
		List<ProjectPOJO> projectPOJOList = new ArrayList<ProjectPOJO>();
		
		while (rs.next()) {		
			ProjectPOJO projectPOJO = new ProjectPOJO();
			projectPOJO.setProjectCode(rs.getString("project_code"));
			projectPOJO.setProjectDescription(rs.getString("project_desc"));
			projectPOJO.setProjectId(rs.getInt("project_id"));
			projectPOJO.setTotalResource(rs.getInt("total_resource"));
			
			projectPOJOList.add(projectPOJO);	
		}
		log.info(LoggingConstants.returnedMessage);
		return projectPOJOList;
	}

	@Override
	public ProjectPOJO MapObject(ResultSet rs) throws SQLException {
		log.info(LoggingConstants.entryMessage);
		log.info(LoggingConstants.returnedMessage);
		log.info("null return");
		
		return null;
	}

}
